package com.gdth.widget.listview.adapter;

import java.util.List;

import com.gdth.R;
import com.gdth.model.Item;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class SpinnerListAdapter extends BaseListViewAdapter{
	
	public SpinnerListAdapter(Context mContext, List<Item> items){
		super(mContext, items);
		
		layout = R.layout.spinner_item;
	}

	@Override
	public View getView(int arg0, View convertView, ViewGroup arg2) {
		// TODO Auto-generated method stub
        convertView = LayoutInflater.from(mContext).inflate(layout, null);
        
        if(convertView!=null) {
            TextView text_item=(TextView)convertView.findViewById(R.id.info);
            text_item.setText(items.get(arg0).getValue());
            convertView.setTag(items.get(arg0).getKey());
        }
        
        return convertView;
	}
}
